def fact1(num):
    sum = 1
    for n in range(2,num+1):
        sum =sum*n
    return sum

def fact2(num):
    if num==1:return 1
    return num*fact2(num-1)

print(f"{fact1(4)=}")
print(f"{fact2(4)=}")

for i  in range(1,10):
    print(f"{fact2(i)=}")


def harmoic(num):
    if num==1: return 1
    return harmoic(num-1)+1/num

print(f"调和数：{harmoic(4)=}")

def gcp(p,q):
    if q==0:return p
    return gcp(q,p%q)

print(f"最大公约数：{gcp(60,128)=}")

